package com.tbit.uqbike.client.service.impl;

import com.tbit.uqbike.client.dao.core.BatteryModelDetailDao;
import com.tbit.uqbike.client.pojo.BatteryModelDetail;
import com.tbit.uqbike.client.service.BatteryModelDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service("batteryModelDetailService")
public class BatteryModelDetailServiceImpl implements BatteryModelDetailService {
    @Autowired
    private BatteryModelDetailDao batteryModelDetailDao;

    @Override
    public List<BatteryModelDetail> getByBatteryModelId(Integer batteryModelId) {
        return batteryModelDetailDao.getByBatteryModelId(batteryModelId);
    }

    @Override
    public BatteryModelDetail getByMachineId(Integer machineId, Float vol) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("machineId", machineId);
        params.put("vol", vol);

        return batteryModelDetailDao.getByMachineId(params);
    }

}  